unit Map_P4;

interface

uses
  SysUtils, Classes, ADODB, DB, DataEngine, Class_P4;

type
  TMap_P4 = class(TDataEngine)
  public
    FTableName: string;
  public
    function ReadDS(AADODst: TADODataSet): TBaseClass; override;
    function GetStrsIndex(ABaseClass: TBaseClass): string; override;

    function GetStrInsert: string; override;
    function GetStrUpdate: string; override;
    function GetStrDelete: string; override;
    procedure SetParameters(ABaseClass: TBaseClass); override;

    function GetP4(CodeA: Integer; StrsListA: TStringList): TP4;
  end;

implementation

{ TMap_P4 }

function TMap_P4.GetP4(CodeA: Integer; StrsListA: TStringList): TP4;
var
  I: Integer;
begin
  Result := nil; 
  if CodeA < 1 then Exit;
  for I := 0 to StrsListA.Count - 1 do
  begin
    if TP4(StrsListA.Objects[I]).YUE = CodeA then
    begin
      Result := TP4(StrsListA.Objects[I]);
      Exit;
    end;
  end;
end;

function TMap_P4.GetStrDelete: string;
begin
  Result := '';
end;

function TMap_P4.GetStrInsert: string;
begin
  Result := '';
end;

function TMap_P4.GetStrsIndex(ABaseClass: TBaseClass): string;
begin
  Result := '';
end;

function TMap_P4.GetStrUpdate: string;
begin
  Result := '';
end;

function TMap_P4.ReadDS(AADODst: TADODataSet): TBaseClass;
begin
  Result := TP4.Create;
  with TP4(Result) do
  begin
    YUE := AADODst.FieldByName('YUE').AsInteger;
    JZR := AADODst.FieldByName('JZR').AsString;
    JZSJ := AADODst.FieldByName('JZSJ').AsString;
  end;
end;

procedure TMap_P4.SetParameters(ABaseClass: TBaseClass);
begin
  inherited;

end;

end.
